#!/bin/bash

# Тест работы универсального парсера с грамматикой из "книги дракона""

echo "Тесты парсера ====================================" > test/tmp/test-parse.out

bin/simodo-grammatize -u -z slr test/source/grammar/book/book.fuze >> test/tmp/test-parse.out

for file in test/source/grammar/book/*.dsl
do
    echo "--- ${file} :" >> test/tmp/test-parse.out
    cat ${file} >> test/tmp/test-parse.out
    echo "--- parse :" >> test/tmp/test-parse.out
    bin/simodo-parse -l --lex data/grammar/lex/lex-book.json -g test/source/grammar/book/book.fuze ${file} >> test/tmp/test-parse.out
done

exit 0
